<?php
opentable("Most Popular Songs");
$result = dbquery("SELECT * FROM ".$db_prefix."charts ORDER BY 'vote' DESC");
echo "<table width='100%' class='tbl'>
<tr>
    <td><b>".$locale['ctbs003']."</b></td>
    <td><b>".$locale['ctbs004']."</td></b>
    <td><b>".$locale['ctbs005']."</td></b>
    <td><b>".$locale['ctbs006']."</td></b>
    <td><b>".$locale['ctbs007']."</td></b>
</tr>";
if (isset($_COOKIE['fusion_songs'])) {
  $disable = "disabled";
}
else
{
  $disable = "";
}
$x = 0;
while ($data = dbarray($result))
{
  $x++;
  $votes = $data['vote'];
  echo"
  <form action='".$PHP_SELF."' method='post'>
  <input type='hidden' name='art_id' value='".$data['id']."'>
  <input type='hidden' name='votes' value='".$data['vote']."'>
  <tr>
    <td>".$x.".</td>
    <td>".$votes."</td>
    <td>".$data['artist']."</td>
    <td>".$data['title']."</td>
    <td><input type='submit' value='".$locale['ctbs007']."' name='send' class='button' $disable></td>
    </form>
  </tr>";
}
echo "</table>";
closetable();
?>